<?php
/**
 ***** 扶摇而上、抱守本真 ******
 * @author Dana
 * @Date 2021/6/28
 */

$db = new PDO('mysql:host=localhost;dbname=test','test','123456');

$email = $_GET['email'];
var_dump($email);
$time = date('Y-m-d');


$verify_string = '';
for($i = 0;$i < 16;$i++){
    $verify_string .=chr(mt_rand(32,126));
}

$sql = "INSERT INTO users (email, created, verify_string, verified) VALUES ()";
$db->exec($sql) or die(print_r($db->errorInfo(), true));

$verify_string = urlencode($verify_string);
$safe_email = urlencode($email);

$verify_url = "http://dana.com/web/verifyUser.php";

$mail_body=<<<_MAIL_
To $email:
please click on the following link to verify your account creation:
url  $verify_url?email=$safe_email&verify_string=$verify_string
if you do not verify your account in the next seven days,it will be deleted.
_MAIL_;

echo $mail_body;


